<template>
  <view class="success-page">
    <view class="success-animation">
      <view class="success-circle">
        <image class="success-icon" src="../../static/images/click.png" />
      </view>
    </view>

    <view class="success-content">
      <text class="success-title">支付成功</text>
      <text class="success-message">您的订单已支付成功，感谢您的购买！</text>
    </view>

    <view class="action-buttons">
      <navigator url="/pages/order/order?state=0" open-type="redirect" class="view-order-btn">查看订单</navigator>
      <navigator url="/pages/index/index" open-type="switchTab" class="home-btn">返回首页</navigator>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {}
}
</script>

<style lang="scss">

.success-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #fff;
  padding: 80rpx 30rpx;

  // Success Animation
  .success-animation {
    margin-top: 80rpx;
    margin-bottom: 50rpx;

    .success-circle {
      width: 180rpx;
      height: 180rpx;
      border-radius: 50%;
      background: linear-gradient(145deg, #f0f0f0, #ffffff);
      box-shadow: 20rpx 20rpx 60rpx #d9d9d9, -20rpx -20rpx 60rpx #ffffff;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      animation: pulse 2s infinite ease-in-out;

      .success-icon {
        width: 120rpx;
        height: 120rpx;
        animation: scale 0.5s ease-out;
      }
    }
  }

  // Success Content
  .success-content {
    text-align: center;
    margin-bottom: 80rpx;

    .success-title {
      font-size: 48rpx;
      font-weight: 600;
      color: #138f87;
      margin-bottom: 20rpx;
      display: block;
    }

    .success-message {
      font-size: 28rpx;
      color: #666;
      display: block;
    }
  }

  // Action Buttons
  .action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    .view-order-btn, .home-btn {
      width: 80%;
      height: 90rpx;
      border-radius: 45rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 30rpx;
      font-weight: 500;
      transition: all 0.3s ease;
    }

    .view-order-btn {
      background: linear-gradient(to right, #138f87, #45BAB2);
      color: #fff;
      margin-bottom: 30rpx;
      box-shadow: 0 4px 15px rgba(19, 143, 135, 0.2);

      &:active {
        transform: scale(0.98);
      }
    }

    .home-btn {
      background-color: #fff;
      color: #666;
      border: 1px solid #ddd;

      &:active {
        background-color: #f5f5f5;
      }
    }
  }
}

// Animations
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(19, 143, 135, 0.2);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15rpx rgba(19, 143, 135, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(19, 143, 135, 0);
  }
}

@keyframes scale {
  0% {
    transform: scale(0);
  }

  70% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}

/* 主题颜色变量 - 可以直接使用 */
$primary-color: #138f87;
$primary-light: #45bab2;
$primary-dark: #0a6561;
$secondary-color: #ff6b6b;
$text-color-dark: #333333;
$text-color-medium: #666666;
$text-color-light: #999999;
$background-color: #f8f9fa;

/* 通用样式增强 */
.enhanced {
  /* 卡片样式 */
  &-card {
    background-color: #ffffff;
    border-radius: 12rpx;
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
    padding: 20rpx;
    margin-bottom: 20rpx;

    &-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding-bottom: 15rpx;
      border-bottom: 1px solid rgba(0, 0, 0, 0.05);
      margin-bottom: 15rpx;

      .title {
        font-size: 32rpx;
        font-weight: 600;
        color: $text-color-dark;
      }
    }
  }

  /* 按钮样式 */
  &-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80rpx;
    font-size: 28rpx;
    border-radius: 40rpx;
    transition: all 0.3s ease;

    &-primary {
      background: linear-gradient(to right, $primary-color, $primary-light);
      color: #ffffff;
      box-shadow: 0 4rpx 15rpx rgba($primary-color, 0.2);

      &:active {
        transform: scale(0.98);
      }
    }

    &-outline {
      background-color: #ffffff;
      color: $text-color-medium;
      border: 1px solid #dddddd;

      &:active {
        background-color: #f5f5f5;
      }
    }
  }

  /* 徽章样式 */
  &-badge {
    display: inline-block;
    padding: 4rpx 12rpx;
    border-radius: 4rpx;
    font-size: 22rpx;
    font-weight: 600;

    &-primary {
      background-color: $primary-color;
      color: #ffffff;
    }

    &-secondary {
      background-color: $secondary-color;
      color: #ffffff;
    }
  }

  /* 表单元素样式 */
  &-input {
    width: 100%;
    height: 80rpx;
    border-radius: 40rpx;
    background-color: #f5f5f5;
    padding: 0 30rpx;
    font-size: 28rpx;
    margin-bottom: 20rpx;

    &:focus {
      outline: none;
      box-shadow: 0 0 0 2px rgba($primary-color, 0.2);
    }
  }

  /* 单选按钮样式 */
  &-radio {
    display: flex;
    align-items: center;

    &-outer {
      width: 40rpx;
      height: 40rpx;
      border-radius: 50%;
      border: 2px solid #dddddd;
      display: flex;
      justify-content: center;
      align-items: center;
      transition: border-color 0.3s ease;

      &.checked {
        border-color: $primary-color;
      }

      .radio-inner {
        width: 20rpx;
        height: 20rpx;
        border-radius: 50%;
        background-color: $primary-color;
      }
    }
  }
}

/* 商店页面样式增强 */
.shop-page {
  background-color: $background-color;
  min-height: 100vh;

  .header {
    padding: 20rpx;
    background-color: #ffffff;
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);

    .search-container {
      display: flex;
      align-items: center;
      position: relative;

      .search-icon {
        width: 40rpx;
        height: 40rpx;
        position: absolute;
        left: 20rpx;
        z-index: 1;
      }

      .search-input {
        flex: 1;
        height: 70rpx;
        border-radius: 35rpx;
        background-color: #f5f5f5;
        padding-left: 70rpx;
        font-size: 28rpx;
      }

      .menu-icon {
        width: 50rpx;
        height: 50rpx;
        margin-left: 20rpx;
      }
    }
  }

  .carousel {
    margin: 0 20rpx 30rpx;
    border-radius: 12rpx;
    overflow: hidden;
    box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);

    .carousel-image {
      width: 100%;
      height: 100%;
      border-radius: 12rpx;
    }
  }

  .category-grid {
    display: flex;
    justify-content: space-between;
    padding: 30rpx 20rpx;
    background-color: #ffffff;
    border-radius: 12rpx;
    margin: 0 20rpx 30rpx;
    box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);

    .category-item {
      display: flex;
      flex-direction: column;
      align-items: center;

      .category-icon {
        width: 100rpx;
        height: 100rpx;
        border-radius: 50%;
        background-color: #f5f5f5;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-bottom: 15rpx;
        transition: all 0.3s ease;
        box-shadow: 0 4rpx 8rpx rgba($primary-color, 0.15);

        image {
          width: 60rpx;
          height: 60rpx;
        }

        &:hover {
          transform: translateY(-3rpx);
        }
      }

      .category-name {
        font-size: 24rpx;
        color: $text-color-medium;
        text-align: center;
      }
    }
  }

  .section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20rpx;

    .title-text {
      display: flex;
      flex-direction: column;

      .primary-title {
        font-size: 32rpx;
        font-weight: 600;
        color: $text-color-dark;
      }

      .secondary-title {
        font-size: 22rpx;
        color: $text-color-light;
      }
    }
  }

  .product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20rpx;
    padding: 0 20rpx 30rpx;

    .product-card {
      background-color: #ffffff;
      border-radius: 12rpx;
      overflow: hidden;
      box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
      transition: transform 0.3s ease, box-shadow 0.3s ease;

      &:hover {
        transform: translateY(-5rpx);
        box-shadow: 0 8rpx 15rpx rgba(0, 0, 0, 0.1);
      }

      .product-image {
        position: relative;
        height: 200rpx;

        image {
          width: 100%;
          height: 100%;
          object-fit: cover;
        }

        .discount-badge {
          position: absolute;
          top: 10rpx;
          right: 10rpx;
          background-color: $secondary-color;
          color: #ffffff;
          padding: 4rpx 8rpx;
          border-radius: 4rpx;
          font-size: 22rpx;
          font-weight: bold;
        }
      }

      .product-info {
        padding: 20rpx;

        .product-name {
          font-size: 28rpx;
          font-weight: 600;
          color: $text-color-dark;
          margin-bottom: 10rpx;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          overflow: hidden;
        }

        .product-description {
          font-size: 24rpx;
          color: $text-color-light;
          margin-bottom: 15rpx;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
          overflow: hidden;
        }

        .product-price {
          display: flex;
          align-items: baseline;

          .currency {
            font-size: 24rpx;
            color: $primary-color;
          }

          .amount {
            font-size: 32rpx;
            font-weight: bold;
            color: $primary-color;
          }
        }
      }
    }
  }
}

/* 商品详情页样式增强 */
.product-detail-page {
  background-color: $background-color;

  .image-carousel {
    width: 100%;
    height: 750rpx;

    .product-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .product-info-card {
    background-color: #ffffff;
    padding: 30rpx;
    margin-bottom: 20rpx;

    .product-title {
      font-size: 36rpx;
      font-weight: 600;
      color: $text-color-dark;
      margin-bottom: 20rpx;
    }

    .price-container {
      display: flex;
      align-items: center;
      margin-bottom: 20rpx;

      .currency-symbol {
        font-size: 32rpx;
        color: $secondary-color;
      }

      .price-amount {
        font-size: 48rpx;
        font-weight: bold;
        color: $secondary-color;
      }

      .original-price {
        font-size: 28rpx;
        color: $text-color-light;
        text-decoration: line-through;
        margin-left: 16rpx;
      }

      .discount-badge {
        background-color: $secondary-color;
        color: #ffffff;
        font-size: 22rpx;
        padding: 4rpx 12rpx;
        border-radius: 4rpx;
        margin-left: 16rpx;
      }
    }

    .stats-row {
      display: flex;
      font-size: 24rpx;
      color: $text-color-light;

      .stat-item {
        margin-right: 30rpx;
      }
    }
  }

  .promotion-card {
    background-color: #fff5f5;
    padding: 20rpx 30rpx;
    margin-bottom: 20rpx;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .options-card {
    background-color: #ffffff;
    margin-bottom: 20rpx;

    .option-item {
      display: flex;
      padding: 30rpx;
      border-bottom: 1px solid #f5f5f5;

      &:last-child {
        border-bottom: none;
      }

      .option-label {
        width: 160rpx;
        font-size: 28rpx;
        color: $text-color-medium;
      }

      .option-value {
        flex: 1;
        font-size: 28rpx;
        color: $text-color-dark;

        &.highlight {
          color: $secondary-color;
        }
      }
    }
  }


}

/* 支付页面样式增强 */
.payment-page {
  background-color: $background-color;
  min-height: 100vh;
  padding: 30rpx;

  .amount-card {
    background-color: #ffffff;
    border-radius: 12rpx;
    padding: 40rpx 0;
    margin-bottom: 30rpx;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);

    .amount-label {
      font-size: 30rpx;
      color: $text-color-medium;
      margin-bottom: 20rpx;
    }

    .amount-value {
      display: flex;
      align-items: flex-start;

      .currency {
        font-size: 36rpx;
        font-weight: 500;
        color: $text-color-dark;
        margin-top: 8rpx;
      }

      .amount {
        font-size: 60rpx;
        font-weight: bold;
        color: $text-color-dark;
      }
    }
  }

  .payment-methods {
    background-color: #ffffff;
    border-radius: 12rpx;
    margin-bottom: 50rpx;
    box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.05);
    overflow: hidden;

    .payment-method {
      display: flex;
      align-items: center;
      padding: 30rpx;
      border-bottom: 1px solid #f5f5f5;
      transition: background-color 0.3s ease;

      &:last-child {
        border-bottom: none;
      }

      &.selected {
        background-color: rgba($primary-color, 0.05);
      }

      .method-icon {
        width: 80rpx;
        height: 80rpx;
        background-color: #f8f9fa;
        border-radius: 12rpx;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20rpx;

        image {
          width: 50rpx;
          height: 50rpx;
        }
      }

      .method-info {
        flex: 1;

        .method-name {
          font-size: 30rpx;
          font-weight: 500;
          color: $text-color-dark;
          margin-bottom: 4rpx;
        }

        .method-desc {
          font-size: 24rpx;
          color: $text-color-light;
        }
      }
    }
  }

  .confirm-button {
    width: 100%;
    height: 90rpx;
    background: linear-gradient(to right, $primary-color, $primary-light);
    color: #ffffff;
    border-radius: 45rpx;
    font-size: 32rpx;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    box-shadow: 0 4rpx 15rpx rgba($primary-color, 0.2);
    transition: transform 0.2s ease;

    &:active {
      transform: scale(0.98);
    }
  }
}

/* 支付成功页面样式增强 */
.success-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: #ffffff;
  padding: 80rpx 30rpx;

  .success-animation {
    margin-top: 80rpx;
    margin-bottom: 50rpx;

    .success-circle {
      width: 180rpx;
      height: 180rpx;
      border-radius: 50%;
      background: linear-gradient(145deg, #f0f0f0, #ffffff);
      box-shadow: 20rpx 20rpx 60rpx #d9d9d9, -20rpx -20rpx 60rpx #ffffff;
      display: flex;
      justify-content: center;
      align-items: center;
      position: relative;
      animation: pulse 2s infinite ease-in-out;

      .success-icon {
        width: 120rpx;
        height: 120rpx;
        animation: scale 0.5s ease-out;
      }
    }
  }

  .success-content {
    text-align: center;
    margin-bottom: 80rpx;

    .success-title {
      font-size: 48rpx;
      font-weight: 600;
      color: $primary-color;
      margin-bottom: 20rpx;
      display: block;
    }

    .success-message {
      font-size: 28rpx;
      color: $text-color-medium;
      display: block;
    }
  }

  .action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;

    .view-order-btn, .home-btn {
      width: 80%;
      height: 90rpx;
      border-radius: 45rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 30rpx;
      font-weight: 500;
      transition: all 0.3s ease;
    }

    .view-order-btn {
      background: linear-gradient(to right, $primary-color, $primary-light);
      color: #ffffff;
      margin-bottom: 30rpx;
      box-shadow: 0 4rpx 15rpx rgba($primary-color, 0.2);

      &:active {
        transform: scale(0.98);
      }
    }

    .home-btn {
      background-color: #ffffff;
      color: $text-color-medium;
      border: 1px solid #dddddd;

      &:active {
        background-color: #f5f5f5;
      }
    }
  }
}

/* 动画效果 */
@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba($primary-color, 0.2);
  }

  70% {
    transform: scale(1.05);
    box-shadow: 0 0 0 15rpx rgba($primary-color, 0);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba($primary-color, 0);
  }
}

@keyframes scale {
  0% {
    transform: scale(0);
  }

  70% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
  }
}
</style>